import com.eastcom.groovy.tools.common.ShellExecutor
void startDerbyDataBase() {
//    ShellExecutor shellExecutor = new ShellExecutor("java -jar C:\\db-derby-10.10.2.0-bin\\lib\\derbyrun.jar server start", false);
//    shellExecutor.exec();
//    try {
//        Thread.sleep(2000);
//    } catch (InterruptedException e) {
//        e.printStackTrace();
//    }
}
void stopDerbyDataBase(){
//    ShellExecutor shellExecutor = new ShellExecutor("java -jar C:\\db-derby-10.10.2.0-bin\\lib\\derbyrun.jar server shutdown", false);
//    shellExecutor.exec();
//    try {
//        Thread.sleep(2000);
//    } catch (InterruptedException e) {
//        e.printStackTrace();
//    }
}
//void loadDb
println '初始化开始！'
String flag = this.getBinding().getVariable("flag")
println '初始化标志：'+flag
if(flag.equalsIgnoreCase("startDerbyDataBase")){
    startDerbyDataBase()
}else if(flag.equalsIgnoreCase("stopDerbyDataBase")){
    stopDerbyDataBase()
}
println '初始化结束！'